package com.qfhd.soft.cjzcore.UI.Custom;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.qfhd.soft.cjzcore.R;


public class CJCardView extends RelativeLayout {
    private Context mContext;
    private AttributeSet mAttr;

    private RelativeLayout ggkClickView;
    private TextView tx_nextTime;
    private TextView tx_hadCount;

    public CJCardView(Context context) {
        this(context,null);
    }

    public CJCardView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public CJCardView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context,attrs);
    }

    private void init(Context context,AttributeSet attr){
        mContext    = context;
        mAttr       = attr;

        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View mView              = inflater.inflate(R.layout.card_layout,this,true);
        ggkClickView            = mView.findViewById(R.id.ggk_rel);
        tx_nextTime             = mView.findViewById(R.id.ggk_nextTime);
        tx_hadCount             = mView.findViewById(R.id.ggk_haveCount);
    }

    public void showNextTimeTip(String nextTime,int totalCount){
        tx_nextTime.setText(nextTime + " 【" + totalCount +"张】");
    }

    public void showHadTip(int hadCount,int totalCount){
        tx_hadCount.setText(hadCount + "/" + totalCount);
    }

    public RelativeLayout getGgkClickView(){
        return ggkClickView;
    }
}
